package com.springboot.mybatis.service.rabbitmq;

import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @author sunyt31481
 * @date 2020/8/13 16:58
 * @description
 */
@Component
@RabbitListener(bindings = {
        @QueueBinding(
                exchange = @Exchange(value = "fanoutExchangeName", type = "fanout"),
                value = @Queue
        )
})
public class CustomerSpringRabbitMqFanoutDemo {
    @RabbitHandler
    public void receive(String message){
        System.out.println("message "+message);
    }
}
